package uba.fi.tda.tp1.sorts;

public class InsertionSort extends GenericSort{

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected int[] sortMethod(int[] numbers) {
		
		for(int i=1; i<numbers.length;i++){
			int aux = numbers[i]; 
			int j;
			for(j=i-1; j>=0 && numbers[j]>aux; j--){
				numbers[j+1] = numbers[j];
			}
			numbers[j+1] = aux;
		}

		return numbers;
	}
}
